package com.bea.ftd.dashboard.controller;

import java.util.stream.Stream;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bea.ftd.common.enums.EncryptEnum;
import com.bea.ftd.common.enums.EncryptStrategy;
import com.bea.ftd.common.enums.MsgType;
import com.bea.ftd.common.enums.ParamType;
import com.bea.ftd.common.enums.RateLimiteTypeEnum;

@RestController
@RequestMapping("/constants")
public class ConstantController {

	@RequestMapping("/getMessageTypes")
	public MsgType[] getMessageTypes() {
		return MsgType.values();
	}

	@RequestMapping("/getMesssgeParamTypes")
	public ParamType[] getMesssgeParamTypes() {
		return ParamType.values();
	}

	@RequestMapping("/getEncryptStrategies")
	public String[] getEncryptStrategies() {
		return Stream.of(EncryptStrategy.values()).map(e -> e.getValue()).toArray(String[]::new);
	}

	@RequestMapping("/getAllRateLimiteTypes")
	public RateLimiteTypeEnum[] getAllRateLimiteTypes() {
		return RateLimiteTypeEnum.values();
	}
	
	@RequestMapping("/getEncryptTypes")
	public EncryptEnum[] getEncryptTypes() {
		return EncryptEnum.values();
	}
}
